<?php

/**
 * This is the model class for table "store_config".
 *
 * The followings are the available columns in table 'store_config':
 * @property integer $id
 * @property string $store_name
 * @property string $store_intro
 * @property string $email
 * @property string $address
 * @property string $phones
 * @property string $hotlines
 * @property string $skype
 * @property string $facebook
 * @property string $yahoo
 * @property string $googleplus
 * @property string $paygate
 * @property string $bank_info
 * @property string $video_url
 * @property string $title
 * @property string $googlemap
 * @property string $image_map
 * @property string $twitter
 * @property string $ads_image
 * @property string $ads_title
 * @property string $ads_link
 * @property string $other_sites
 * @property string $profile_link
 */
class StoreConfigModel extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return StoreConfigModel the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'store_config';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('store_name, store_intro, email, address, phones, hotlines, skype, facebook, yahoo, googleplus, paygate, bank_info, video_url, title, googlemap, image_map, twitter, ads_image, ads_title, ads_link, other_sites, profile_link', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, store_name, store_intro, email, address, phones, hotlines, skype, facebook, yahoo, googleplus, paygate, bank_info, video_url, title, googlemap, image_map, twitter, ads_image, ads_title, ads_link, other_sites, profile_link', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'store_name' => 'Store Name',
			'store_intro' => 'Store Intro',
			'email' => 'Email',
			'address' => 'Address',
			'phones' => 'Phones',
			'hotlines' => 'Hotlines',
			'skype' => 'Skype',
			'facebook' => 'Facebook',
			'yahoo' => 'Yahoo',
			'googleplus' => 'Googleplus',
			'paygate' => 'Paygate',
			'bank_info' => 'Bank Info',
			'video_url' => 'Video Url',
			'title' => 'Title',
			'googlemap' => 'Googlemap',
			'image_map' => 'Image Map',
			'twitter' => 'Twitter',
			'ads_image' => 'Ads Image',
			'ads_title' => 'Ads Title',
			'ads_link' => 'Ads Link',
			'other_sites' => 'Other Sites',
			'profile_link' => 'Profile Link',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('store_name',$this->store_name,true);
		$criteria->compare('store_intro',$this->store_intro,true);
		$criteria->compare('email',$this->email,true);
		$criteria->compare('address',$this->address,true);
		$criteria->compare('phones',$this->phones,true);
		$criteria->compare('hotlines',$this->hotlines,true);
		$criteria->compare('skype',$this->skype,true);
		$criteria->compare('facebook',$this->facebook,true);
		$criteria->compare('yahoo',$this->yahoo,true);
		$criteria->compare('googleplus',$this->googleplus,true);
		$criteria->compare('paygate',$this->paygate,true);
		$criteria->compare('bank_info',$this->bank_info,true);
		$criteria->compare('video_url',$this->video_url,true);
		$criteria->compare('title',$this->title,true);
		$criteria->compare('googlemap',$this->googlemap,true);
		$criteria->compare('image_map',$this->image_map,true);
		$criteria->compare('twitter',$this->twitter,true);
		$criteria->compare('ads_image',$this->ads_image,true);
		$criteria->compare('ads_title',$this->ads_title,true);
		$criteria->compare('ads_link',$this->ads_link,true);
		$criteria->compare('other_sites',$this->other_sites,true);
		$criteria->compare('profile_link',$this->profile_link,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}